/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Dotke
 */
@Entity
@Table(name = "FINANCIALSTATEMENT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Financialstatement.findAll", query = "SELECT f FROM Financialstatement f"),
    @NamedQuery(name = "Financialstatement.findByStatementId", query = "SELECT f FROM Financialstatement f WHERE f.statementId = :statementId"),
    @NamedQuery(name = "Financialstatement.findByStatementDateTime", query = "SELECT f FROM Financialstatement f WHERE f.statementDateTime = :statementDateTime"),
    @NamedQuery(name = "Financialstatement.findByStatementBalance", query = "SELECT f FROM Financialstatement f WHERE f.statementBalance = :statementBalance")})
public class Financialstatement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "STATEMENT_ID")
    private Integer statementId;
    @Basic(optional = false)
    @Column(name = "STATEMENT_DATE_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date statementDateTime;
    @Basic(optional = false)
    @Column(name = "STATEMENT_BALANCE")
    private int statementBalance;
    @JoinColumn(name = "STATEMENT_ACCOUNT_ID", referencedColumnName = "ACCOUNT_ID")
    @ManyToOne(optional = false)
    private Account statementAccountId;

    public Financialstatement() {
    }

    public Financialstatement(Integer statementId) {
        this.statementId = statementId;
    }

    public Financialstatement(Integer statementId, Date statementDateTime, int statementBalance) {
        this.statementId = statementId;
        this.statementDateTime = statementDateTime;
        this.statementBalance = statementBalance;
    }

    public Integer getStatementId() {
        return statementId;
    }

    public void setStatementId(Integer statementId) {
        this.statementId = statementId;
    }

    public Date getStatementDateTime() {
        return statementDateTime;
    }

    public void setStatementDateTime(Date statementDateTime) {
        this.statementDateTime = statementDateTime;
    }

    public int getStatementBalance() {
        return statementBalance;
    }

    public void setStatementBalance(int statementBalance) {
        this.statementBalance = statementBalance;
    }

    public Account getStatementAccountId() {
        return statementAccountId;
    }

    public void setStatementAccountId(Account statementAccountId) {
        this.statementAccountId = statementAccountId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (statementId != null ? statementId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Financialstatement)) {
            return false;
        }
        Financialstatement other = (Financialstatement) object;
        if ((this.statementId == null && other.statementId != null) || (this.statementId != null && !this.statementId.equals(other.statementId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistence.entity.Financialstatement[ statementId=" + statementId + " ]";
    }
    
}
